syncthing: bump to 2.0.9
authorGeorge Sapkin <[email protected]>
Sun, 31 Aug 2025 17:20:15 +0000 (20:20 +0300)
committerGeorge Sapkin <[email protected]>
Sun, 21 Sep 2025 11:20:53 +0000 (14:20 +0300)
Major version change that switches DB backend from
LevelDB to SQLite. Requires golang 1.24+.

- improve syncthing argument parsing to be more
  robust
- remove unused and add updated config options

Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.0
Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.1
Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.2
Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.3
Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.4
Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.5
Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.6
Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.7
Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.8
Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.9
Signed-off-by: George Sapkin <[email protected]>
wip

Signed-off-by: George Sapkin <[email protected]>
utils/syncthing/Makefile
utils/syncthing/files/stdiscosrv.conf
utils/syncthing/files/strelaysrv.conf
utils/syncthing/files/syncthing.conf
utils/syncthing/files/syncthing.init

index 08703e0fc7bf641dc156253a1bc74dec8aa23a40..dfd2411510099283306f7757a553e173f44ef44c 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=syncthing
-PKG_VERSION:=1.30.0
-PKG_RELEASE:=3
+PKG_VERSION:=2.0.9
+PKG_RELEASE:=1
 
 PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION)
-PKG_HASH:=ef1be71c66753c04212ab1c9c548e678d468bad98dc5461e83540a4ef5c2fcba
+PKG_HASH:=803ea5e50c0cdb465b03245a75715d3a9c69f929876d0956ef07c6f3a25dee69
 
 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)
 
index 5606c5f25219385208a5b4b31e50498142e9203a..08a95f039684e0fae1b8ff4d41cdefb0143dd984 100644 (file)
@@ -4,7 +4,7 @@ config stdiscosrv 'stdiscosrv'
        option listen ':8443'
        option db_dir '/etc/stdiscosrv/discovery.db'
 
-       # Find the documents from: https://docs.syncthing.net/users/stdiscosrv.html
+       # More info: https://docs.syncthing.net/users/stdiscosrv.html
        # option cert '/etc/stdiscosrv/cert.pem'
        # option key '/etc/stdiscosrv/key.pem'
        # option db_flush_interval '5m'
index 7c33a30ec4442e86f44fb54ab4bb6f076a904a36..3c2b40a7f2d338c8194f36617bcb25a3ef359382 100644 (file)
@@ -4,7 +4,7 @@ config strelaysrv 'strelaysrv'
        option keys '/etc/strelaysrv'
        option listen ':22067'
 
-       # Find the documents from: https://docs.syncthing.net/users/strelaysrv.html
+       # More info: https://docs.syncthing.net/users/strelaysrv.html
        # option ext_address ''
        # option global_rate ''
        # option message_timeout '1m0s'
index 6c388cc871da13759e642561d91595a70e10c587..51b18f9d66e74d0c7d504b296ca7125375a8c169 100644 (file)
@@ -4,35 +4,30 @@ config syncthing 'syncthing'
 
        option gui_address 'http://0.0.0.0:8384'
 
-       # Use internal flash for evaluation purpouses. Use external storage
-       #   for production.
-       # This filesystem must either support ownership/attributes or
-       #   be readable/writable by the user specified in
-       #   'option user'.
+       # Use internal flash for evaluation purposes. Use external storage for
+       # production. This filesystem must either support ownership/attributes or
+       # be readable/writable by the user specified in 'option user'.
        # Consult syslog if things go wrong.
        option home '/etc/syncthing'
 
-       # Changes to "niceness"/macprocs are not picked up by "reload_config"
-       #   nor by "restart": the service has to be stopped/started
-       #   for those to take effect
+       # Changes to "niceness"/macprocs are not picked up by "reload_config" or by
+       # "restart": the service has to be stopped/started for those to take effect.
        option nice '19'
 
        # 0 to match the number of CPUs (default)
        # >0 to explicitly specify concurrency
        option macprocs '0'
 
+       # More info: https://docs.syncthing.net/users/syncthing.html
+       # option db_delete_retention_interval ''
+       # option db_maintenance_interval ''
+       # option gui_apikey ''
+
        # Running as 'root' is possible, but not recommended
-       option user 'syncthing'
+       option user 'syncthing'
 
-       option logfile '/var/log/syncthing.log'
-       option log_max_old_files 7
+       option log_file '/var/log/syncthing.log'
+       # option log_level 'INFO'
+       option log_max_old_files '7'
        # Size in bytes
-       option log_max_size 1048576
-
-       # # CLI options with no value should be defined as booleans and theirs
-       # # names should be prefixed with '_'.
-       option _no_default_folder '1'
-
-       # # Extra settings
-       # list _ 'verbose'
-
+       option log_max_size '1048576'
index 6cc907c284102b38a49608a72393eaedd89a2214..13c20dbd810ea668b62b05fcd33feec95824befc 100644 (file)
@@ -13,72 +13,53 @@ config_cb() {
        option_cb() {
                local option="$1"
                local value="$2"
+
                case $option in
-               enabled|gui_address|home|logfile|macprocs|nice|user)
-                       eval $option=$value
-                       ;;
-               debug)
-                       extra_args="$extra_args --${option//_/-}-$value"
-                       ;;
-               _*)
-                       [ "$value" = "0" ] || extra_args="$extra_args -${option//_/-}"
-                       ;;
-               *)
-                       extra_args="$extra_args --${option//_/-}=$value"
+
+               # Support old option names
+               logfile)
+                       option='log_file'
                        ;;
+
                esac
-       }
 
-       list_cb() {
-               local name="$1"
-               local value="$2"
-               [ "$name" = "_" ] && extra_args="$extra_args --${value//_/-}" || return 0
+               eval $option="$value"
        }
 }
 
-service_triggers()
-{
-       procd_add_reload_trigger "syncthing"
+service_triggers() {
+       procd_add_reload_trigger 'syncthing'
 }
 
 start_service() {
-       local extra_args="--no-browser"
-
-       # Options with default value different with the syncthing should be defined explicitly here
+       # Options with default value different with the syncthing should be defined
+       # explicitly here
        local enabled=0
-       local gui_address="http://0.0.0.0:8384"
-       local home="/etc/syncthing"
-       local logfile="/var/log/syncthing.log"
+       local db_delete_retention_interval=''
+       local db_maintenance_interval=''
+       local gui_address='http://0.0.0.0:8384'
+       local gui_apikey=''
+       local home='/etc/syncthing'
+       local log_file='/var/log/syncthing.log'
+       local log_level='INFO'
+       local log_max_old_files=7
+       local log_max_size=1048576
        local macprocs=0
        local nice=0
-       local user="syncthing"
+       local user='syncthing'
 
-       config_load "syncthing"
+       config_load 'syncthing'
 
        local group=$(id -gn $user)
 
-       # Some of the default values below might not match the defaults
-       #   in /etc/config/syncthing: the reason is to remain backwards
-       #   compatible with the older versions of this service as it
-       #   evolves.
        [ "$enabled" -gt 0 ] || return 0
 
-       # For backwards compatibility
-       IDX_DB=$(readlink -n "$home"/index-v0.14.0.db)
-       if [ ! -z "$IDX_DB" ]; then
-               [ -d "$IDX_DB" ] || mkdir -p "$IDX_DB"
-
-               # A separate step to handle an upgrade use case
-               [ -d "$IDX_DB" ] && chown -R $user:$group "$IDX_DB"
-       fi
-
        [ -d "$home" ] || mkdir -p "$home"
        # A separate step to handle an upgrade use case
        [ -d "$home" ] && chown -R $user:$group "$home"
 
-       # Changes to "niceness"/macprocs are not picked up by "reload_config"
-       #   nor by "restart": the service has to be stopped/started
-       #   for it to take effect
+       # Changes to "niceness"/macprocs are not picked up either by reload_config
+       # or by restart: the service has to be stopped/started for it to take effect
        if [ $macprocs -le 0 ]; then
                # Default to the number of cores in this case
                macprocs=$(grep -c ^processor /proc/cpuinfo)
@@ -86,16 +67,26 @@ start_service() {
 
        procd_open_instance
        procd_set_param command "$PROG"
-       procd_set_param env GOMAXPROCS="$macprocs" STNOUPGRADE=1
+       procd_set_param env GOMAXPROCS="$macprocs"
        procd_append_param command serve
+       [ -z "$db_delete_retention_interval" ] || procd_append_param command --db-delete-retention-interval="$db_delete_retention_interval"
+       [ -z "$db_maintenance_interval" ] || procd_append_param command --db-maintenance-interval="$db_maintenance_interval"
        procd_append_param command --gui-address="$gui_address"
+       [ -z "$gui_apikey" ] || procd_append_param command --gui_apikey="$gui_apikey"
        procd_append_param command --home="$home"
-       procd_append_param command --logfile="$logfile"
-       [ -z "$extra_args" ] || procd_append_param command $extra_args
+       procd_append_param command --log-file="$log_file"
+       [ -z "$log_level" ] || procd_append_param command --log-level="$log_level"
+       [ -z "$log_max_old_files" ] || procd_append_param command --log-max-old-files="$log_max_old_files"
+       [ -z "$log_max_size" ] || procd_append_param command --log-max-size="$log_max_size"
+       procd_append_param command --no-browser
+       procd_append_param command --no-port-probing
+       procd_append_param command --no-restart
+       # The package is built with noupgrade tag so --no-upgrade is not necessary
 
        procd_set_param nice "$nice"
        procd_set_param term_timeout 15
        procd_set_param user "$user"
+       procd_set_param group "$group"
        procd_set_param respawn
        procd_set_param stdout 0
        procd_set_param stderr 1